package com.kq.tallybookl.util;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 * 获取MD5加密信息
 *
 * Created by Kq on 2016/4/29.
 */
public class GetMD5 {

    /**
     * 使用MD5加密文字
     * @param text
     * @return
     */
    public static String getMD5(String text){

        String invisible_text = text;
        try {
            MessageDigest md5 = MessageDigest.getInstance("MD5");
            byte[] bytes = md5.digest(text.getBytes());
            invisible_text = new String(bytes);
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        return invisible_text;
    }
}
